//-------------------------------------------------------------------
//	Copyright (c) 2010-2012 Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_LIGHT_TECHNIQUE_H
#define _UX_LIGHT_TECHNIQUE_H

#include "../Passes/IRTPass.h"

namespace Engine
{
namespace RenderUtils
{

	//
	// Light Technique Instance interface
	//

	class ILightTechInstance
	{
	public:
		virtual void Free() = 0;
	};



	//
	// Light Technique interface
	//

	class ILightTechnique
	{
	public:
		virtual bool CreateInstance(IRTPass *, ILightTechInstance *&) = 0;

		virtual e_light::bits	GetLightBits() const = 0;
		virtual e_shadow::bits	GetShadowBits() const = 0;
	};



	//
	// Deferred Lighting Technique
	//

	class _EXPORT_ CDeferredLightingTech : public CEngBaseObject, public ILightTechnique
	{
	protected:

		//
		// Deferred Lighting Technique Instance
		//

		class CDLInstance : public ILightTechInstance
		{
		private:
			// lighting only //
			void _DrawOmniLightSphere();
			void _DrawOmniLightSphereInst();
			void _DrawDirectionalLightQuad();
			void _DrawDirectionalLightQuadArray();
			void _DrawSpotLightCone();
			void _DrawSpotLightConeInst();
			void _DrawOmniLightBillboard();
			void _DrawOmniLightBillboardArray();

			// lighting and shading //
			void _DrawOmniLightSphereWithShadow();
			void _DrawDirectionalLightQuadWithShadow();
			void _DrawSpotLightConeWithShadow();
			void _DrawOmniLightBillboardWithShadow();

			// create shadow matrix //
			void _CreateOmniLightCamera();
			void _CreateSpotLightCamera();
			void _CreateDirectionalLightCamera();

		public:
			virtual void Free();
		};

	protected:

	public:
		virtual bool CreateInstance(IRTPass *, ILightTechInstance *&);

		virtual e_light::bits	GetLightBits() const	{ return e_light::ALL_BITS; }
		virtual e_shadow::bits	GetShadowBits() const	{ return e_shadow::ALL_BITS; }
	};



	//
	// Forward Lighting Technique
	//

	class _EXPORT_ CForwardLightingTech : public CEngBaseObject, public ILightTechnique
	{
	};

//-------------------------------------------------------------------

}	// RenderUtils
}	// Engine

#endif	// _UX_LIGHT_TECHNIQUE_H